<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>NDK Programmer&#39;s Guide: Mips</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">NDK Programmer&#39;s Guide
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('md_3__key__topics__c_p_u__support__c_p_u-_m_i_p_s.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Mips </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h2>Introduction</h2>
<p>Android NDK r8 added support for the 'mips' ABI, that allows native code to run on Android-based devices running on CPUs supporting the MIPS32 instruction set.</p>
<p>The Android 'mips' ABI itself is fully specified in d/CPU-ARCH-ABIS.</p>
<h2>Overview</h2>
<p>Generating mips machine code is simple: just add 'mips' to your APP_ABI definition in your Application.mk file, for example: </p>
<pre class="fragment">    APP_ABI := armeabi armeabi-v7a mips
</pre><p>Alternatively, since NDK r7, you can use: </p>
<pre class="fragment">    APP_ABI := all
</pre><p>will generate machine code for all supported ABIs with this NDK. Doing so will ensure that your application package contains libraries for all target ABIs. Note that this has an impact on package size, since each ABI will correspond to its own set of native libraries built from the same sources.</p>
<p>As you would expect, generated libraries will go into $PROJECT/libs/mips/, and will be embedded into your .apk under /lib/mips/.</p>
<p>And just like other ABIs, the Android package manager will extract these libraries on a <em>compatible</em> mips-based device automatically at install time, to put them under <code>&lt;dataPath&gt;/lib</code>, where <code>&lt;dataPath&gt;</code> is the application's private data directory.</p>
<p>Similarly, the Android Market server is capable of filtering applications based on the native libraries they embed and your device's target CPU.</p>
<p>Debugging with ndk-gdb should work exactly as described under docs/NDK-GDB.html.</p>
<h2>Standalone-toolchain</h2>
<p>It is possible to use the mips toolchain with NDK r8 in stand-alone mode. See docs/STANDALONE-TOOLCHAIN.html for more details. Briefly speaking, it is now possible to run: </p>
<pre class="fragment">    $NDK/build/tools/make-standalone-toolchain.sh --arch=mips --install-dir=&lt;path&gt;
</pre><p>The toolchain binaries have the mipsel-linux-android- prefix.</p>
<h2>Compatibility</h2>
<p>The minimal native API level provided by official Android mips platform builds is 9, which corresponds to all the native APIs provided by Android 2.3, i.e. Gingerbread (note also that no new native APIs were introduced by Honeycomb).</p>
<p>You won't have to change anything to your project files if you target an older API level: the NDK build script will automatically select the right set of native platform headers/libraries for you. For mips, this still corresponds to API level 9 and higher. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Wed Jun 25 2014 00:51:19 for NDK Programmer&#39;s Guide by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
</body>
</html>
